package com.neusoft.springbootredis.service;

import com.neusoft.springbootredis.dao.mapper.UserMapper;
import com.neusoft.springbootredis.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class UserServiceImpl {

    @Autowired
    private UserMapper userMapper;

    @Cacheable(value = "usercache",key = "#a0")
    public User findUser(Integer id){
        return userMapper.findUserByID(id);
    }
}
